Skip to content

feat(cli): record which config key failed in config-load telemetry (CLI-2912) - #7468

Merged
Coly010 merged 4 commits into
developfrom
columferry/cli-2912-record-which-config-key-failed-in-config-load-telemetry
Nov 3, 2026
Merged

Coly010 merged 4 commits into
developfrom
columferry/cli-2912-record-which-config-key-failed-in-config-load-telemetry

Conversation

@Coly010

@Coly010 Coly010 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

A failed cli_command_executed event shows that a command failed on config (error_category: invalid_config, error_fingerprint: tag:StartConfigLoadError), but not which key caused it. So we can't tell how many config-load failures come from the removed [inbucket] section and how many from everything else.

This adds a config_key property to those events.

  • CliConfigValues.load and ResolvedCliConfig.get record the key through the existing recordCommandTelemetry sink when they fail. It has to be recorded at load time because command wrappers such as StartConfigLoadError keep only the message and drop the original error
  • The key comes from three errors:
    • CliConfigRemovedKeyError: every removed key, sorted and comma-joined
    • CliConfigValueError: its path
    • CliConfigParseError: the first issue path, when the cause is a schema error
  • Only key names are recorded, and only from a fixed list built from the CLI's own config schema and registry, plus the four removed keys. Values, file paths, remote names and other user-chosen names never reach the event. A user-chosen segment collapses to its nearest known parent, so functions.my-fn.verify_jwt records functions and a custom auth.external.<name> records auth.external
  • withCommandTelemetry only adds config_key when the event's error_category is invalid_config, so a config failure that a command swallowed can't label a success or an unrelated failure
  • apps/cli/docs/analytics.md documents the new property

The list of removed keys is kept in the CLI rather than exported from @supabase/config, so this change stays out of that package's release train.

Linked issue

Closes CLI-2912

🤖 Generated with Claude Code

…LI-2912)

Failed cli_command_executed events classified invalid_config now carry
config_key, the config key path behind the failure. Keys come from a
closed vocabulary built from the config schema and registry, so values,
file paths and user-chosen names never reach telemetry.
@Coly010
Coly010 requested a review from a team as a code owner November 3, 2026 13:26
@Coly010
Coly010 requested a review from Prashansa-K November 3, 2026 13:26
@Coly010 Coly010 self-assigned this Nov 3, 2026
…erry/cli-2912-record-which-config-key-failed-in-config-load-telemetry

# Conflicts:
#	apps/cli/src/shared/telemetry/event-catalog.ts
#	apps/cli/src/telemetry/command-telemetry-attributes.ts

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Verified all three findings against the checked-out code and trusted conventions. After merging the overlapping stale-key reports, two minor telemetry attribution issues remain confirmed.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/config/cli-config-values.layer.ts:71 telemetry-accuracy claude+codex A recovered config failure can leave its config_key attached to a later, unrelated invalid_config failure. Keyless failures do not clear the previously recorded key, and the final telemetry gate checks only the error category.
🟡 MINOR apps/cli/src/config/cli-config-failure-key.ts:62 telemetry-accuracy codex An unselected remote named after a root config section can cause config_key to identify the remote name instead of the failing section. For example, a remote named auth with db = "invalid" reports auth instead of db.

Stats

Claude findings: 1 · Codex findings: 2 · Confirmed: 2 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit f65709b against develop at 41723ce · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 239 ms 260 ms no real change (+9%, within normal variation)
supabase --help help 227 ms 248 ms no real change (+9%, within normal variation)
supabase init init 352 ms 365 ms no real change
supabase migration new bench migration-new 262 ms 281 ms no real change (+7%, within normal variation)
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 333 ms 377 ms no real change (+13%, within normal variation)
supabase projects list projects-list 254 ms 269 ms no real change (+6%, within normal variation)
supabase functions list --project-ref replayfixtureprojref functions-list 294 ms 301 ms no real change

API calls: unchanged for all 7 commands.

Binary size: 134.1 MB, up 12.0 KB from 134.0 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 204-387 ms 208-316 ms +21 ms (+9%) within noise
supabase --help help 210-286 ms 198-315 ms +21 ms (+9%) within noise
supabase init init 279-474 ms 290-440 ms +13 ms (+4%) within noise
supabase migration new bench migration-new 234-431 ms 225-385 ms +19 ms (+7%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 263-448 ms 245-474 ms +44 ms (+13%) within noise
supabase projects list projects-list 231-349 ms 234-311 ms +15 ms (+6%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 263-655 ms 240-420 ms +7 ms (+2%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

…ovenance

A keyless config failure or a successful load or lookup now clears the recorded key,
so a recovered failure cannot label a later one. Remote-block schema failures are
detected from the decode itself instead of by comparing prefix depth, so a remote
named after a config section reports the failing section.
A successful load or lookup with no earlier failure no longer records an empty
config_key, so commands that assert their recorded attributes see only their own.
@Coly010
Coly010 added this pull request to the merge queue Nov 3, 2026
Merged via the queue into develop with commit 0a245f2 Nov 3, 2026
49 checks passed
@Coly010
Coly010 deleted the columferry/cli-2912-record-which-config-key-failed-in-config-load-telemetry branch November 3, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants